import filter from './common/filter/filter.js'
import location from './common/js/location.js'
import poster from './common/js/poster.js'
import mixin from './common/mixin/mixin.js'
import utils from './common/utils/utils.js'
import Route from './common/route/route.js'

const install = (Vue,vm) => {
	
	//获取route实例
	let route = new Route(vm)
	
	const $ma = {
		route: route.getPath(),
		utils,
		location
	}
	
	Object.keys(filter).forEach(key => Vue.filter(key, filter[key]));
	
	Vue.mixin(mixin);
	
	//挂载到uni上面
	uni.$ma = $ma;
	
	//挂载到Vue全局上下文
	Vue.prototype.$ma = $ma;
	
}

export default { install };